package com.micro.ai.models.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 数据集记录实体类
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("dataset_records")
@Schema(description = "数据集记录信息")
public class DatasetRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "记录ID", example = "rec_123456789")
    private String id;

    /**
     * 租户ID
     */
    @Schema(description = "租户ID", example = "tenant_001", required = true)
    private String tenantId;

    /**
     * 数据集ID
     */
    @Schema(description = "数据集ID", example = "ds_123", required = true)
    private String datasetId;

    /**
     * 记录索引
     */
    @Schema(description = "记录索引", example = "1", required = true)
    private Integer recordIndex;

    /**
     * 输入文本
     */
    @Schema(description = "输入文本", example = "你好，请介绍一下自己", required = true)
    private String inputText;

    /**
     * 输出文本
     */
    @Schema(description = "输出文本", example = "你好，我是一个AI助手", required = true)
    private String outputText;

    /**
     * 指令文本
     */
    @Schema(description = "指令文本", example = "用友好的方式自我介绍")
    private String instruction;

    /**
     * 记录元数据（JSON）
     */
    @Schema(description = "记录元数据（JSON格式）", example = "{\"category\":\"greeting\"}")
    private String metadata;

    /**
     * 质量评分
     */
    @Schema(description = "质量评分（0-1）", example = "1.0")
    private double qualityScore;

    /**
     * 是否有效
     */
    @Schema(description = "是否有效", example = "true")
    private Boolean isValid;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间", example = "2025-01-01 00:00:00")
    private LocalDateTime createdAt;
}
